package com.yingside.io.io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class TestReader {
    public static void main(String[] args) {
        FileReader reader = null;
        try {
            reader = new FileReader("aa.txt");

            char [] cs = new char[50];

            int c = 0;

            while((c = reader.read(cs)) != -1){
                String str = new String(cs,0,c);

                System.out.println("str = " + str);
            }


        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
